<?php
namespace app\store\controller\wxapp;
use app\store\controller\Controller;
use app\store\model\Setting as SettingModel;

/**
 * 小程序订阅消息管理
 */
class Tpl extends Controller
{
    /**
     * 设置
     */
    public function setting()
    {
		if (!$this->request->isAjax()) {
			$values = SettingModel::getItem('tpl');
            return $this->fetch('setting', compact('values'));
        }
        $model = new SettingModel;
        if($model->edit('tpl', $this->postData('tpl'))) {
            return $this->renderSuccess('同步成功');
        }
        $error = $model->getError() ?: '同步失败';
        return $this->renderError($error);
    }
}
